package it.davial.mgwt.client.ui.widget;

import com.google.gwt.user.client.Command; 
import com.google.gwt.user.client.DOM; 
import com.google.gwt.user.client.ui.UIObject; 
public class AreaWidget extends UIObject { 
        private Command command; 
        public AreaWidget() { 
                setElement(DOM.createElement("area")); 
                DOM.setElementAttribute(getElement(), "href", "#"); 
        } 
        public AreaWidget(String shape, String coords, String alt, Command command) { 
                this(); 
                setShape(shape); 
                setCoords(coords); 
                setAlt(alt); 
                this.command = command; 
        } 
        Command getCommand() { 
                return command; 
        } 
        void setAlt(String alt) { 
                DOM.setElementAttribute(getElement(), "alt", (alt == null) ? 
                		"area" : alt); 
        } 
        void setCoords(String coords) { 
                DOM.setElementAttribute(getElement(), "coords", (coords == null) ? 
                		"" : coords); 
        } 
        void setShape(String shape) { 
                DOM.setElementAttribute(getElement(), "shape", (shape == null) ? 
                		"" : shape); 
        } 
} 
